home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / tools / xmstrix.com / HICLEAR.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-11-02  |  1.2 KB  |  55 lines

  1. ;filename HICLEAR.ASM - file to release HMA after running HICOPY.COM
  2. ;Released into the Public Domain - November/88 by D. Roy
  3.  
  4. CODE        SEGMENT PARA PUBLIC 'CODE'
  5.         ASSUME    CS:CODE, DS:CODE ;-----------------------------;
  6.         ORG    100H         ;COM file format! Remember to ;
  7.                      ; use EXE2BIN                 ;
  8. START:                     ;-----------------------------;
  9.     JMP    XMSTEST
  10. ;data area
  11. XMSControl    DD    ?
  12. NODRIVER_MSG    DB    'No XMS driver installed!...$'
  13. BADVERS_MSG    DB    'Requires Version 2.X XMS Driver!...$'
  14. RELEASED_MSG    DB    'HMA released...',10,13,'$'
  15.  
  16. ;code area
  17. XMSTEST:
  18.     MOV    AX,4300h
  19.     INT    2Fh
  20.     CMP    AL,80h
  21.     LEA    DX,NODRIVER_MSG
  22.     JNE    ERROR_EXIT
  23. ;get address of control driver function
  24.     MOV    AX,4310h
  25.     INT    2Fh
  26.     MOV    WORD PTR [XMSControl],BX
  27.     MOV    WORD PTR [XMSControl+2],ES
  28. ;get driver's version number
  29.     MOV    AH,00
  30.     CALL    [XMSControl]
  31.     CMP    AH,2
  32.     LEA    DX,BADVERS_MSG
  33.     JNE    ERROR_EXIT
  34. ;disable the A20 address line
  35.     MOV    AH,4
  36.     CALL    [XMSControl]
  37. ;and release the HMA
  38.     MOV    AH,2
  39.     CALL    [XMSControl]
  40.     LEA    DX,RELEASED_MSG
  41. ERROR_EXIT:
  42.     CALL    WRITE_STRING
  43. EXIT:    INT    20h
  44.  
  45. ;-- subroutines ---------------
  46.  
  47. WRITE_STRING    PROC    NEAR
  48.     MOV    AH,9
  49.     INT    21h
  50.     RET
  51. WRITE_STRING    ENDP
  52.  
  53. CODE        ENDS
  54.     END    START
  55.